package org.study.event.test.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.study.event.test.po.Good;

public interface GoodMapper {

	/***
	 * 保存商品信息
	 * 
	 * @param good
	 */
	public void saveGood(Good good);

	/***
	 * 批量保存
	 * 
	 * @param goodList
	 * @return
	 */
	public void saveGoodList(List<Good> goodList);

	public List<Good> findAll();
	


	/***
	 * 根据商品ID查询商品信息
	 * 
	 * @param goodId
	 * @return
	 */
	public Good findByGoodId(Long goodId);
	
	/**
	 * 查询商品是否锁表
	 * @param goodIds
	 * @param lock
	 * @return
	 */
	public List<Good> findByGoodIds(@Param("goodIds") List<Long> goodIds,@Param("lock")boolean lock);

	/***
	 * 增加商品数量
	 * 
	 * @param goodCount
	 */
	public void addGoodCount(@Param("goodId") Long goodId, @Param("goodCount") Integer goodCount);

	/***
	 * 销售商品数量信息
	 * 
	 * @param goodId
	 * @param goodCount
	 */
	public void saleGoodCount(@Param("goodId") Long goodId, @Param("goodCount") Integer goodCount);

}
